package com.huicoo.forestmanager.base;

import android.graphics.Rect;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by Admin on 2019/4/28.
 * recycler view的间隙
 */
public class BaseRecyclerItemDecoration extends RecyclerView.ItemDecoration {
    private int l, t, r, b;

    public BaseRecyclerItemDecoration(int left, int top, int right, int bottom) {
        this.l = left;
        this.t = top;
        this.r = right;
        this.b = bottom;
    }

    @Override
    public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
        outRect.left = l;
        outRect.top = t;
        outRect.right = r;
        outRect.bottom = b;
    }
}
